Be more careful when faking a button release. (#323146, Travis Abbott)
authorMatthias Clasen <mclasen@redhat.com>
Sun, 24 Dec 2006 06:06:37 +0000 (06:06 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 24 Dec 2006 06:06:37 +0000 (06:06 +0000)
2006-12-24  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkbutton.c (gtk_button_grab_notify): Be more
        careful when faking a button release.  (#323146,
        Travis Abbott)

ChangeLog
gtk/gtkbutton.c

index 426722957fd3fc356ee196be52e5ad14f94fe4df..28c61f9d097da73983e268c1395110c303fb5803 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2006-12-24  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkbutton.c (gtk_button_grab_notify): Be more
+       careful when faking a button release.  (#323146,
+       Travis Abbott)
+
        * gtk/gtkhandlebox.c (draw_textured_frame): Draw the
        handle with the right orientation, depending on the
        position of the handlebox.  (#159764, Benjamin Berg)
index 471d73887db3b5a24f23119c736c5dc8606016db..002241ce10e34fb452dbab1e0f10022b10194aaf 100644 (file)
@@ -1932,11 +1932,18 @@ gtk_button_grab_notify (GtkWidget *widget,
                        gboolean   was_grabbed)
 {
   GtkButton *button = GTK_BUTTON (widget);
+  gboolean save_in;
 
   if (!was_grabbed)
     {
-      button->in_button = FALSE;
+      save_in = button->in_button;
+      button->in_button = FALSE; 
       gtk_real_button_released (button);
+      if (save_in != button->in_button)
+        {
+          button->in_button = save_in;
+          gtk_button_update_state (button);
+        }
     }
 }